//
//  SecondViewController.swift
//  AutoPrint
//
//  Created by 胡玉葱 on 16/9/25.
//  Copyright © 2016年 fatcat. All rights reserved.
//

import UIKit

class SecondViewController: UIViewController {

    override func preferredStatusBarStyle() -> UIStatusBarStyle {
        return .LightContent
    }
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        navigationController?.navigationBar.barStyle = .Black
        navigationController?.navigationBar.barTintColor = Fatcat.THEME_COLOR
        navigationItem.titleView?.tintColor = UIColor.whiteColor()
        
        // Do any additional setup after loading the view, typically from a nib.
        let loginBtn = UIButton(type: .System)
        loginBtn.frame = CGRect(x: 0, y: 0, width: 48, height: 16)
        loginBtn.center = view.center
        loginBtn.setTitle("Login", forState: .Normal)
        loginBtn.addTarget(self, action: #selector(SecondViewController.gotoLogin), forControlEvents: .TouchUpInside)
        view.addSubview(loginBtn)
        
        let testViewBtn = UIButton(type: .System)
        testViewBtn.frame = CGRect(x: 0, y: 100, width: 48, height: 16)
        testViewBtn.center.x = view.center.x
        testViewBtn.setTitle("View", forState: .Normal)
        testViewBtn.addTarget(self, action: #selector(SecondViewController.gotoView), forControlEvents: .TouchUpInside)
        view.addSubview(testViewBtn)
        
        let filePVBtn = UIButton(type: .System)
        filePVBtn.frame = CGRect(x: 0, y: 200, width: 48, height: 16)
        filePVBtn.center.x = view.center.x
        filePVBtn.setTitle("PV", forState: .Normal)
        filePVBtn.addTarget(self, action: #selector(SecondViewController.gotoView), forControlEvents: .TouchUpInside)
        view.addSubview(filePVBtn)
    }

    func gotoLogin(){
        
        presentViewController(UDLoginViewController(), animated: true, completion: nil)
    }
    
    func gotoView(){
        hidesBottomBarWhenPushed = true
        //navigationController?.pushViewController(PreOrderViewController(filePath: "filepath/abc.doc", fileName: "abc.doc", fileSize: "34.53KB"), animated: true)
    }
    
    override func viewWillDisappear(animated: Bool) {
        super.viewWillDisappear(animated)
        hidesBottomBarWhenPushed = false
    }
    
    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }


}

